package com.xxxy.dongyexuan.mapper;

import com.xxxy.dongyexuan.po.Card;
import com.xxxy.dongyexuan.po.Level;
import org.apache.ibatis.annotations.*;
import org.mybatis.spring.annotation.MapperScan;

import java.util.List;

@MapperScan("com.xxxy.dongyexuan.demobeautyhaird.mapper")
public interface ICardMapper {
    @Select("select count(*) from card")
    public int getcount();

    @Select("SELECT * FROM card WHERE cid = #{cid}")
    public Card findById(@Param("cid") int cid);

    @Select("SELECT * FROM card")
    public List<Card> findAll();

    @Insert("INSERT card VALUES (#{cid}, #{balance},#{uid})")
    public int save(Card card);

    @Update("UPDATE card SET balance = #{balance},uid=#{uid} WHERE cid = #{cid}")
    public int merge(Card card);

    @Delete("DELETE FROM card WHERE cid = #{cid}")
    public int delete(@Param("cid") int cid);
    @Select("select * from card limit #{from},#{pagesize}")
    public List<Card> findByPage(@Param("from") int from, @Param("pagesize") int pagesize);
}
